<div class="module-setting">
  <ol class="breadcrumb fn-clearfix">
    <li>网站维护</li>
    <li>项目方账户配置</li>
  </ol>
  <div class="ui-box">
    <form class="form-horizontal" role="form">
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label">项目方：</label>
        <div class="col-sm-2">
          <select class="form-control" ng-model="vm.coinType" ng-change="vm.changeCoinType(coinType)" placeholder="请选择项目方">
            <option ng-bind:value="coin.value" ng-repeat="coin in coinList">{{coin.label}}</option>
          </select>
        </div>
      </div>
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label">账号：</label>
        <div class="col-sm-2">
          <input type="text" maxlength="50" class="form-control" ng-model="vm.account" placeholder="请输入账户" />
        </div>
      </div>
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label">lkex平台UID：</label>
        <div class="col-sm-2">
          <input type="text" maxlength="50" class="form-control" ng-model="vm.uid" placeholder="请输入lkex平台UID" />
        </div>
      </div>
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label">用户名：</label>
        <div class="col-sm-2">
          <input type="text" maxlength="50" class="form-control" ng-model="vm.userName" placeholder="请输入用户名" />
        </div>
      </div>
      <div class="form-group">
        <label for="name" class="col-sm-2 control-label"></label>
        <div class="col-sm-2">
          <button type="button" class="btn btn-primary btn-block" ng-click="vm.submit()">确定添加账户</button>
        </div>
      </div>
    </form>
  </div>
  <div class="ui-box">
    <div class="info-box">
      <span class="info-label">账户列表</span>
    </div>
    <table class="table table-striped table-hover table-bordered">
      <thead>
        <tr>
          <th width="10%">项目方</th>
          <th width="20%">账户</th>
          <th width="10%">用户名</th>
          <th width="20%">添加时间</th>
          <th width="10%">状态</th>
          <th width="10%">操作</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="item in vm.list" ng-if="vm.isLoading === false && vm.list.length > 0">
          <td>{{item.assetCode}}</td>
          <td>{{item.account}}</td>
          <td>{{item.userName}}</td>
          <td>{{$root.moment(item.createDate - 0).utc().utcOffset($root.ZONE).format('YYYY-MM-DD HH:mm:ss')}}</td>
          <td ng-class="{
            greentradedetail:item.status=='VALID',
            redtradedetail:item.status=='INVALID'}">
            {{item.status == 'VALID' ? '正常' : '停用'}}
          </td>
          <td>
            <a ng-if="item.status=='VALID'" ng-click="vm.setAccountStatus(item)" ng-class="{redtradedetail:item.status=='VALID'}"
              href="javascript:;">停用</a>
            <a ng-if="item.status=='INVALID'" ng-click="vm.setAccountStatus(item)" ng-class="{greentradedetail:item.status=='INVALID'}"
              href="javascript:;">启用</a>
            &emsp;&emsp;
            <a href="javascript:;" ng-click="vm.setPwd(item)">重置登录密码</a>
          </td>
        </tr>
        <tr class="ui-no-data" ng-if="vm.isLoading === false && (vm.list.length === 0||vm.list===null)">
          <td colspan="9">暂无数据</td>
        </tr>
        <tr class="ui-loading" ng-if="vm.isLoading === true">
          <td colspan="9">正在加载，请稍候...</td>
        </tr>
      </tbody>
    </table>

    <div class="ui-pager-box" ng-if="vm.totalNum > 0">
      <ul uib-pagination previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" total-items="vm.totalNum"
        ng-model="vm.pageNo" max-size="5" items-per-page="vm.pageSize || 10" align="right" class="pagination"
        boundary-links="true" ng-change="vm.pageChanged()" rotate="false"></ul>
    </div>
  </div>

</div>